#include <cstdio>
#include <algorithm>
#include <cmath>
#include <cstring>

using namespace std;

#define maxn 110

const double zero=1e-8;
const double pi=acos(-1.);

struct point{
	double x, y;
	point( double xx=0, double yy=0 ){
		x=xx; y=yy;
	}
	point operator -( const point &b ) const{
	    return point( x-b.x, y-b.y );
	}
	bool operator ==( const point &b ) const{
		return fabs(x-b.x)<=zero && fabs( y-b.y )<=zero;
	}
	double operator *( const point &b ) const{
	    return x*b.y-b.x*y;
	}    
};

struct circle{
	point ct;
	double r;
	bool operator ==( const circle &b ) const{
		return ct==b.ct && fabs(r-b.r)<zero;
	}
};

struct seg{
	double s,t;
};

int n, toti;
circle c[maxn];
seg have[maxn];
int hash[100007];
point dd[maxn*maxn];
int next[maxn*maxn];
int toth;
int tot;
int nxt[maxn*maxn];
bool can[maxn*maxn];
double ans;
int now;

double sqr( double x ){
	return x*x;
}

double dist(point a, point b){
	return sqrt(sqr(a.x-b.x)+sqr(a.y-b.y));
}

bool isin(int i, int j){
	return ( c[j].r - dist( c[i].ct, c[j].ct ) - c[i].r>=-zero);
}

void get_cross(int i, int j){
	if ( c[i].r+c[j].r-dist( c[j].ct, c[i].ct )<=zero ) return;
	double cotmp, tmp, now, aa, bb, cc;
	now=atan2( c[j].ct.y-c[i].ct.y, c[j].ct.x-c[i].ct.x );
	if ( now<-zero ) now+=2*pi;
	double l=dist( c[i].ct, c[j].ct );
	cotmp=(sqr(c[i].r)+sqr(l)-sqr(c[j].r))/2/c[i].r/l;
	tmp=acos(cotmp);
	double t1=now-tmp, t2=now+tmp;
	if ( t1<-zero ) t1+=2*pi;
	if ( t2-2*pi>zero ) t2-=2*pi;
	if ( t1>t2 ) t2+=2*pi;
	have[tot].s=t1; have[tot].t=t2;
	tot++;
}

bool cmp( seg a, seg b ){
	return a.s<b.s;
}

int where( point t ){
	int tmp=int( abs(t.x+t.y+zero )*100000 )%100007;
	int tt=hash[tmp];
	while ( tt!=0 ){
		if ( dd[tt]==t ) return tt;
		tt=next[tt];
	}
	toth++; dd[toth]=t; next[toth]=hash[tmp]; hash[tmp]=toth; return toth;
}

double get_chord( double r, double a ){
	return r*r*(a-sin(a))/2;
}

void prepare(){
	for ( int i=0; i<n; i++){
		tot=0;
		for ( int j=0; j<n; j++)
			if ( i!=j )
				get_cross(i, j);
		if ( tot==0 )
			ans+=pi * sqr( c[i].r );
		else {
			sort( have, have+tot, cmp );
			int t=tot; tot=1;
			for ( int j=1; j<t; j++ )
				if ( have[j].s>have[tot-1].t+zero )
					have[tot++]=have[j];
				else
					if ( have[j].t>have[tot-1].t )
						have[tot-1].t=have[j].t;
			if ( tot>1 && have[tot-1].t+zero>have[0].s+2*pi ){
				have[0].s=have[tot-1].s-2*pi;
				if ( have[tot-1].t-2*pi>have[0].t ) have[0].t=have[tot-1].t-2*pi;
				tot--;
			}
			t=tot; tot=1;
			for ( int j=1; j<t; j++ )
				if ( have[j].s>have[tot-1].t )
					have[tot++]=have[j];
				else
					if ( have[j].t>have[tot-1].t )
						have[tot-1].t=have[j].t;
			if ( tot==1 && have[0].s+2*pi<=have[0].t+zero ) continue;
			have[tot]=have[0]; have[tot].s+=2*pi;
			for ( int j=0; j<tot; j++ ){
				ans+=get_chord( c[i].r,have[j+1].s-have[j].t );
				point p1=point( c[i].ct.x+c[i].r*cos(have[j].t), c[i].ct.y+c[i].r*sin(have[j].t) );
				point p2=point( c[i].ct.x+c[i].r*cos(have[j+1].s), c[i].ct.y+c[i].r*sin(have[j+1].s) );
				int t1=where(p1), t2=where(p2);
				nxt[t1]=t2;
			}
		}
	}
}

void count(){
	memset(can,false,sizeof(can));
	for ( int i=1; i<=toth; i++ )
		if ( ! can[i] ){
			int now=i;
			do{
				can[now]=true;
				ans-=dd[nxt[now]]*dd[now]/2;
				now=nxt[now];
			} while (now==i);
		}
}

int main(){
	int i;
	
	scanf("%d", &n);
	for (int i=0; i<n; i++)
		scanf("%lf%lf%lf", &c[i].ct.x, &c[i].ct.y, &c[i].r);

	memset(can, true, sizeof(can));
	for ( int i=0; i<n; i++){
		if ( c[i].r<zero ) can[i]=false;
		for ( int j=i+1; j<n; j++)
			if ( c[i]==c[j] )
				can[j]=false;
	}
	for ( int i=0; i<n; i++)
		if ( can[i] )
			for ( int j=0; j<n; j++){
				if ( i==j || ! can[j] ) continue;
				if (isin(i, j)){
					can[i]=false; break;
				}
			}

	int tmp;
	tmp=n; n=0;
	
	for (i=0; i<tmp; i++)
		if ( can[i] )
			c[n++]=c[i];

	ans=0;
	prepare();
	count();

	printf("%.5lf\n", ans);
}
